package com.neudeu.zy;

public class SalariedEmployee extends ColaEmployee{
    //成员变量
    //月薪
     double salaryMonth;
    //行为方法
    //重写父类的方法计算当前子类的工资：当前工资+生日金
    //此处使用了多态：子类重写了父类的同名方法

    @Override
    public double getSalary(int month) {
        //计算当前子类的工资：当前工资+生日金
        double mySalary=salaryMonth+super.getSalary(month);
        return mySalary;
    }

    public SalariedEmployee(String eName,  int eBirthdayMonth, double salaryMonth) {
        //通过super关键字，调用父类构造方法
        super(eName,  eBirthdayMonth);
        this.salaryMonth = salaryMonth;
    }

    public SalariedEmployee(double salaryMonth) {
        this.salaryMonth = salaryMonth;
    }

    public SalariedEmployee() {
    }

    public double getSalaryMonth() {
        return salaryMonth;
    }

    public void setSalaryMonth(double salaryMonth) {
        this.salaryMonth = salaryMonth;
    }
}
